/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package merlion.crm.sopm.session;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import javax.ejb.Local;
import merlion.common.util.exception.NotExistException;
import merlion.crm.sopm.entity.PurchaseOrder;
import merlion.crm.sopm.entity.RequestForQuotation;
import merlion.crm.sopm.entity.SalesInquiry;
import merlion.crm.sopm.entity.SalesOrder;
import merlion.crm.sopm.entity.SalesQuotation;
import merlion.mrp.ppm.entity.Product;

/**
 *
 * @author Yuwei
 */
@Local
public interface SOPSessionBeanLocal {
    //public ArrayList<Integer> getOrderDiscounts(ArrayList<Long> productIds, ArrayList<Integer> orderQtys);
    public PurchaseOrder savePurchaseOrder (PurchaseOrder purchaseOrder);
    public SalesOrder saveSalesOrder(SalesOrder salesOrder);
    public RequestForQuotation saveRequestForQuotation (RequestForQuotation requestForQuotation);
    public SalesQuotation saveSalesQuotation (SalesQuotation sq);
    public SalesQuotation saveEditSalesQuotation(SalesQuotation sq);
    public void createSalesOrder(PurchaseOrder purchaseOrder);
    public void updateSalesOrder(SalesOrder salesOrder);
    public ArrayList<SalesOrder> viewHistoricalSalesOrder();
    public ArrayList<Product> getProducts();
    public SalesInquiry saveSalesInquiry(SalesInquiry sl);  
    public SalesInquiry getSalesInquiryById(String idStr) throws NotExistException;
    public RequestForQuotation getRequestForQuotationById(String idStr)throws NotExistException;
    public SalesQuotation getSalesQuotationById(String idStr)throws NotExistException;
    public PurchaseOrder getPurchaseOrderById(String idStr)throws NotExistException;
    public SalesOrder getSalesOrderById(String idStr) throws NotExistException;
    public PurchaseOrder viewPurchaseOrder(Long id) throws Exception;
    public List<SalesInquiry> getAllSalesInquirys();
    public List<SalesQuotation> getAllSalesQuotations();
    public List<PurchaseOrder> getAllPurchaseOrders();
    public List<SalesOrder> getAllSalesOrders();
    public List<RequestForQuotation> getAllRequestForQuotation();
    public List<SalesQuotation> getAllSalesQuotation();
    public String saveChangedSalesOrder(SalesOrder so);
    public String generateSalesQuotationId();
    public String generateSalesOrderId();
    public String generateSalesInquiryId();
    //public merlion.crm.sopm.entity.PurchaseOrder viewPurchaseOrder(java.lang.Long id) throws java.lang.Exception;

    public HashMap getSalesFiguireLstOfLst(int numOfYears);

    public HashMap getSalesRevenueFiguresLstOfLst(int numOfYears);
    
    public void cancelSalesOrder(String idStr);
    
    public Boolean checkDuplicatePoNumber(String poNum);
}
